package com.cssw.fyzb.busi.service.acct;


import com.cssw.fyzb.core.model.dodb.*;
import com.cssw.fyzb.core.model.vo.acct.AcctGlobalVo;
import com.cssw.fyzb.core.model.vo.acct.SoundValueVo;
import com.cssw.fyzb.core.model.eos.AcctLogEo;
import com.cssw.fyzb.core.model.vo.acct.UserAcctVo;
import com.ydn.dbframe.plugin.activerecord.Page;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author zhouxu
 * @create 2020-12-18 09:20
 */
public interface AcctService {

    /**
     * 创建账户
     *
     * @param userId
     * @param acctType
     */
    Long createAcct(Long userId, String acctType);

    /**
     * 根据用户标识和账户类型查询账户信息
     *
     * @param userId
     * @param acctType
     */
    Acct queryAcctByUIdAndType(Long userId, String acctType);

    /**
     * 账本全局信息查询
     *
     * @param userId
     * @return
     */
    AcctGlobalVo queryAcctGlobal(Long userId);

    /**
     * 账本流水查询
     *
     * @param userId
     * @param acctType
     * @return
     */
    Page<AcctLogEo> queryAcctLog(Long userId, String acctType, Integer page, Integer limit);

    /**
     * 加账
     *
     * @param userId
     * @param acctType
     * @param value
     * @param tradeId
     * @param tradeType
     * @param busiType
     */
    void addBalance(Long userId, String acctType, BigDecimal value,
                    String tradeId, String tradeType, String busiType, String tradeName);

    /**
     * 减账
     *
     * @param userId
     * @param acctType
     * @param value
     * @param tradeId
     * @param tradeType
     * @param busiType
     */
    void minusBalance(Long userId, String acctType, BigDecimal value,
                      String tradeId, String tradeType, String busiType, String tradeName);


    List<RnbExchangeFDef> queryRnbBuyFDef();

    List<RnbExchangeGzDef> queryRnbBuyGzDef();

    RnbExchangeFDef findRnbBuyFDef(Long rfId);

    RnbExchangeGzDef findRnbBuyGzDef(Long rgId);

    /**
     * 转账
     *
     * @param transferType
     * @param money
     * @param fromUserId
     * @param toUserId
     */
    void transfer(String transferType, BigDecimal money, Long fromUserId, Long toUserId);

    //添加转账日志
    Long addTransferLog(String acctType, Long fromUserId, Long toUserId, BigDecimal amount, String remark);

    //音值体现
    SoundValueVo soundValue(Long userId);

    /**
     * （用户音值福币（金币）） 废弃
     *
     * @return
     * @Param
     **/
    UserAcctVo cmfUser(Long userId, String acctType);

    /**
     * 根据团队数量查询果子价格
     *
     * @param num
     */
    TeamGzPrice getTeamGzPriceByNum(Integer num);

    List<TeamGzPrice> listTeamGzPrice();

    void saveRnbExchangeCoinLog(Long userId, BigDecimal rnb, String acctType,
                                BigDecimal coin, String tradeNo, String status, String remark);
}
